package com.framework.modules.YhbUser.controller;

import com.framework.exception.util.RespResult;
import com.framework.modules.YhbUser.serivce.YhbCustomerService;
import com.framework.modules.sys.controller.AbstractController;
import com.framework.page.PageUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

/**
 *商户控制器
 */
@RequestMapping("sys/customer")
@RestController
public class YhbCustomerController extends AbstractController {

    @Autowired
    private YhbCustomerService yhbCustomerService;

    /**
     * 申请用户列表
     * @param params
     * @return
     */
    @RequestMapping("list")
    public RespResult queryCustomerPage(@RequestParam Map<String,Object> params){

            params.put("userId",getDeptUserId());

        PageUtils page=yhbCustomerService.queryCustomerPage(params);
        return RespResult.ok().put("page",page);
    }

    /**
     * 审核用户
     * @param yhbCusTerId
     * @param state
     * @return
     */
    @RequestMapping("exmaine")
    public RespResult exmaineCuster(String yhbCusTerId,Integer state){

        yhbCustomerService.exmaineCuster(yhbCusTerId,state);
        return RespResult.ok();
    }



}
